# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=shards
pkgver=0.11.1
pkgrel=1
_minitestver=0.5.0
_molinillover=0.1.0
pkgdesc="Dependency manager for the Crystal language"
url="https://github.com/crystal-lang/shards"
arch="x86_64 aarch64"
license="Apache-2.0"
depends="crystal git"
makedepends="yaml-dev"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/crystal-lang/shards/archive/v$pkgver.tar.gz
	minitest.cr-$_minitestver.tar.gz::https://github.com/ysbaddaden/minitest.cr/archive/v$_minitestver.tar.gz
	molinillo-$_molinillover.tar.gz::https://github.com/crystal-lang/crystal-molinillo/archive/v$_molinillover.tar.gz
	"

export CRYSTAL_CACHE_DIR="$srcdir/.cache"

prepare() {
	default_prepare

	mkdir -p lib
	ln -s ../../minitest.cr-$_minitestver lib/minitest
	ln -s ../../crystal-molinillo-$_molinillover lib/molinillo
}

build() {
	make
}

check() {
	export EMAIL="Test User <user@example.com>"
	make test_integration
}

package() {
	make install DESTDIR="$pkgdir" PREFIX=/usr
}

sha512sums="59a1bd563101c3b3175bd586cc205a821b5087fc70b6bc14fbb612b325c18aa0a2d9b8159ad115e227c9321b1d40703fd7062b413b92252e6efd2ee081d1a221  shards-0.11.1.tar.gz
ecd0661340f4d5fa61a730c0ad4e9b8463fe5df32a54c979f28dfe663ed2e40ff19b212e18bb81c89275039474f8ec1072b3c2c5fdf5396973f8a9f641b653cb  minitest.cr-0.5.0.tar.gz
8d74d95896cd7ff510c87e2ffba6ae5f04ceeddde574930ee609851312b65d713a315cc24f9aa3fab02f9447ccb25ef2dd2e8179640b8c5cfb3d7d6b52d1ded5  molinillo-0.1.0.tar.gz"
